import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);
const actions={
    WaitAdd(context,value) {
        setTimeout(() => {
            context.commit('JIA',value)
        }, 1000)
    }
}
const mutations={
JIA(state,value){
    state.num+=value
},
SUB(state,value) {
   state.num-=value
},
}
const state={
    num:0
}
export default new Vuex.Store({
actions,
mutations,
state
})